const state = {
    defaultOrderNum:"",
    relateOrders:"",
    planTime:"",
    applyPerson:{},
    provideCompany:{},
    relateType:"",
    package:"",
    inspection:"",
    purchaseEditInfoCache:{
      id:"",
      orderState:"",
      defaultOrderNum:"",
      relateOrders:"",
      planTime:"",
      applyPerson:{},
      provideCompany:{},
      relateType:"",
      package:"",
      inspection:""
    }
  }
  
  const mutations = {
    SET_DEFAULT_ORDER_NUM: (state, orderNumber) => {
      state.defaultOrderNum = orderNumber;
    },
    SET_RELATE_ORDERS:(state, relateOrders) => {
      state.relateOrders = relateOrders;
    },
    SET_PLAN_TIME:(state, planTime) => {
      state.planTime = planTime;
    },
    SET_APPLY_PERSON:(state, applyPerson) => {
      state.applyPerson = applyPerson;
    },
    SET_PROVIDE_COMPANY:(state, provideCompany) => {
      state.provideCompany = provideCompany;
    },
    set_relate_type:(state,relateType) => {
      state.relateType = relateType;
    },
    set_package:(state,username) => {
      state.package = username;
    },
    set_inspection:(state,username) => {
      state.inspection = username;
    },
    CLEAR_DEFAULT_ORDER_NUM:(state) => {
      state.defaultOrderNum = "";
    },
    CLEAR_RELATE_ORDERS:(state) => {
      state.relateOrders = "";
    },
    CLEAR_PLAN_TIME:(state) => {
      state.planTime = "";
    },
    CLEAR_APPLY_PERSON:(state) => {
      state.applyPerson = {};
    },
    CLEAR_PROVIDE_COMPANY:(state) => {
      state.provideCompany = {};
    },
    CLEAR_STATE:(state) => {
      state.defaultOrderNum = "";
      state.relateOrders = "";
      state.planTime = "";
      state.applyPerson = {};
      state.provideCompany = {};
      state.relateType = "";
      state.package = "";
      state.inspection = "";
    },
    SET_CACHE_DEFAULT_ORDER_NUM:(state,defaultOrderNum) => {
      state.purchaseEditInfoCache.defaultOrderNum = defaultOrderNum;
    },
    SET_CACHE_RELATE_ORDERS:(state,relateOrders) => {
      state.purchaseEditInfoCache.relateOrders = relateOrders;
    },
    SET_CACHE_PLAN_TIME:(state,planTime) => {
      state.purchaseEditInfoCache.planTime = planTime;
    },
    SET_CACHE_APPLY_PERSON:(state,applyPerson) => {
      state.purchaseEditInfoCache.applyPerson = applyPerson;
    },
    SET_CACHE_PROVIDE_COMPANY:(state,provideCompany) => {
      state.purchaseEditInfoCache.provideCompany = provideCompany;
    },
    SET_CACHE_ID:(state, id) => {
      state.purchaseEditInfoCache.id = id;
    },
    SET_CACHE_STATE:(state, orderState) => {
      state.purchaseEditInfoCache.orderState = orderState;
    },
    set_cache_relateType:(state,relateType) => {
      state.purchaseEditInfoCache.relateType = relateType;
    },
    set_cache_package:(state,username) => {
      state.purchaseEditInfoCache.package = username;
    },
    set_cache_inspection:(state,username) => {
      state.purchaseEditInfoCache.inspection = username;
    },
    clear_cache_relateType:(state) => {
      state.purchaseEditInfoCache.relateType = "";
    },
    CLEAR_PURCHASE_EDIT_INFO_CACHE:(state) => {
      state.purchaseEditInfoCache = {
        id:"",
        state:"",
        defaultOrderNum:"",
        relateOrders:"",
        planTime:"",
        applyPerson:{},
        provideCompany:{},
        stateType:"",
        package:"",
        inspection:""
      }
    }
  }
  
  const actions = {
    //
  }
  
  export default {
    namespaced: true,
    state,
    mutations,
    actions
  }
  